<template>
	<view>
		加盟店管理
		<cc-wxBtn v-for="(item,index) in shoplist" :key="index" :title="item.company_name"
			@menuClick="shopselectsubmit(item)"></cc-wxBtn>
	</view>
</template>

<script>
	import {
		postrequest
	} from '../../common/apis.js';

	export default {
		name: "shopmemage",
		data() {
			return {
				page: 1,
				pagesize: 20,
				shoplist: ''
			};
		},
		mounted() {
			this.getshoplist()
		},
		methods: {
			getshoplist() {
				console.log('getfranchiselist')
				let data = {
					username: uni.getStorageSync('username'),
					password: uni.getStorageSync('password'),
					page: 1,
					pagesize: this.pagesize,
					searchkeyword: this.searchkeyword,
					searchfield: this.searchfield
				}
				let url = 'https://www.jsyufang.com/yiXun/api/get_erp_corp_shop/index.asp'
				let errmessage = '获取加盟店列表接口调用失败'
				postrequest(url, data, errmessage, true)
					.then((res) => {
						console.log(res.data.data)
						this.shoplist = res.data.data
					})
			},
			shopselectsubmit(item) {
				this.$emit('shopselectsubmit', item)
			}
		}
	}
</script>

<style>

</style>